import asyncio, aiohttp, json


async def fetch(session, url):
    async with session.get(url) as response:
        response = await response.json()
        print(response)
        datas = response['data']
        for data in datas:
            print(data['title'])
        return response
async def main():
    async with aiohttp.ClientSession() as session:
        urls = [f'https://api.web.360kan.com/v1/rank?cat={i}' for i in range(1, 7)]
        await asyncio.gather(*[fetch(session, url)for url in urls])

response = asyncio.run(main())
# print(response['data']['title'])


import threading
import requests


def fetch(url):
    response = requests.get(url)
    response_data = response.json()
    print(response_data)
    datas = response_data['data']
    for data in datas:
        print(data['title'])
    return response_data


def main():
    urls = [f'https://api.web.360kan.com/v1/rank?cat={i}' for i in range(1, 7)]
    threads = [threading.Thread(target=fetch, args=(url,)) for url in urls]

    for t in threads:
        t.start()
    for t in threads:
        t.join()


if __name__ == "__main__":
    main()
